package com.taobao.common.dao.transaction;

import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.TransactionDefinition;
import org.springframework.transaction.TransactionException;
import org.springframework.transaction.TransactionStatus;

/**
 * @author HGS-���
 * @version $Id: MockTransactionManager.java,v 1.1 2005/04/22 07:16:23 shenyu
 *          Exp $ ���ʲô����������˵���ǳ԰׷���
 */
public class MockTransactionManager implements PlatformTransactionManager {
  private static final TransactionStatus NullTransactionStatus = new TransactionStatus() {

    public boolean isNewTransaction() {
      return false;
    }

    public void setRollbackOnly() {

    }

    public boolean isRollbackOnly() {
      return false;
    }

    public Object createSavepoint() throws TransactionException {
      return null;
    }

    public void rollbackToSavepoint(Object savepoint) throws TransactionException {

    }

    public void releaseSavepoint(Object savepoint) throws TransactionException {

    }

    public boolean hasSavepoint() {

      return false;
    }

    public boolean isCompleted() {
      // TODO Auto-generated method stub
      return false;
    }

    public void flush() {
      // TODO Auto-generated method stub

    }

  };

  public TransactionStatus getTransaction(TransactionDefinition definition) throws TransactionException {
    return NullTransactionStatus;
  }

  public void commit(TransactionStatus status) throws TransactionException {

  }

  public void rollback(TransactionStatus status) throws TransactionException {

  }
}
